<%-- Copyright (C) 2009 WorkSmart Labs, Inc. --%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" import="java.util.*" %>
<%@ page import="com.wsl.HealthChallenge.models.*" %>
<%-- 
    This is a simple JSP template for a test harness used to provide simple
    HTML-based testing for the GetHighScoresController. 
     
    @author artem
--%>

<html>
  <head>
  <%
  String userId = (String) request.getAttribute("userId");
  String userName = (String) request.getAttribute("userName");
  String userScore = (String) request.getAttribute("userScore");

  String challengeName = (String) request.getAttribute("challengeName");
  String numParticipants = (String) request.getAttribute("numParticipants");
  Set<Map.Entry<String, UserStats>> userStats =
      (Set<Map.Entry<String, UserStats>>) request.getAttribute("userStats");  
  %>
    <title><%=challengeName%> - WALK2.me</title>
    <link rel="stylesheet" href="/static/style.css" type="text/css" media="all"/>
  </head>
  <body>
    <br/>
      <div class="light-title"><%=userName%>, welcome to</div>
    <div class="title" style="border-style: none; padding: 0;"><%=challengeName%></div>
    <div class="light-title" style="text-align: right;">powered by Google Health</div>
    <br/>
      <div class="slim" style="padding: 10 25 0 25;">
        Since the start of the contest, you've burned <b><%=userScore%></b> calories!
        <br/><br/>
        You are one of <%=numParticipants%> people in this challenge.
        <br/><br/>
        The folks nearest you are:
      </div>
      <div class="slim" style="margin: 0 150 0 150;">
        <table>
          <% for (Map.Entry<String, UserStats> entry : userStats) { %>
            <tr><td style="width:250px;">
            <% if (entry.getKey().equals(userId)) { %>
              <b>You</b>
            <% } else { %>
              <%=entry.getValue().getName()%>
            <% } %>
            </td><td><%=entry.getValue().getScore()%> calories</td>
            </tr>
          <% } %>
        </table>
      </div>
  </body>
</html>